package main

import (
	"fmt"
	"net"
)

func main() {
	fmt.Println("start server...")
	listen, err := net.Listen("tcp", "localhost:8000")
	if err != nil {
		fmt.Println("监听失败", err)
		return
	}
	for {
		//获取链接
		con, err := listen.Accept()
		if err !=nil {
			fmt.Println("get conn failed...", err)
			return
		}
		//新建线程处理链接
		go delCon(con)

	}
}
